/** @file main_window.h
    @brief Main Window widget */
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H

#include "ui_main_window.h"
#include "objects_dialog.h"

#include <QObject>
#include <QKeyEvent>
#include <QPushButton>
#include <QSignalMapper>

QT_BEGIN_NAMESPACE

class MainWindow : public QMainWindow, private Ui::MainWindow 
{
    Q_OBJECT

    public:
        MainWindow( QWidget *parent = 0 );

        void init();

    public slots:
        void new_map();
        void load_map();
        void save_map();

        void toggle_god_mode( bool b_mode );
        void toggle_physics_debug( bool b_mode );
        void toggle_portals_debug( bool b_mode );

        void start_drawing();
        void start_selection();

        void objects_dialog();

        void roomsize_changed( double f_size );

        void layer_changed( int i_layer );
        void layer_up();
        void layer_down();
        void layer_add();
        void layer_remove();

        void mapped_slot( const QString &r_str );

        void room_picked( pm3::PIXELROOM *p_room );

    protected:
        void setupLayerList();
        void setupActions();
        void updateWidgets();

        void update_status();

        void add_color( const Ogre::ColourValue &r_col );
        void add_colors();
        void clear_colors();

        void add_layer_to_list( int i_layer );
        void add_layers_to_list();
        void clear_layerlist();

        void keyPressEvent( QKeyEvent *p_event );
        void keyReleaseEvent( QKeyEvent *p_event );

        //! Number of screenshots taken
        int m_num_screenshots;

        //! Color buttons
        std::vector< QPushButton * > m_colorbuttons;

        //! Status label on the statusbar
        QLabel *m_status;

        //! Qt signal mapper
        QSignalMapper *m_signal_mapper;
};

QT_END_NAMESPACE

#endif // MAIN_WINDOW_H
